package com.ruoyi.SSL.service.impl;

import java.util.List;

import cn.hutool.core.util.StrUtil;
import com.ruoyi.SSL.domain.SslCloudProductDeploy;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.SSL.mapper.SslCloudKeyMapper;
import com.ruoyi.SSL.domain.SslCloudKey;
import com.ruoyi.SSL.service.ISslCloudKeyService;
import com.ruoyi.common.core.text.Convert;

/**
 * 云厂商key管理Service业务层处理
 *
 * @author ruoyi
 * @date 2024-12-12
 */
@Service
public class SslCloudKeyServiceImpl implements ISslCloudKeyService
{
    @Autowired
    private SslCloudKeyMapper sslCloudKeyMapper;

    /**
     * 查询云厂商key管理
     *
     * @param id 云厂商key管理主键
     * @return 云厂商key管理
     */
    @Override
    public SslCloudKey selectSslCloudKeyById(String id)
    {
        return sslCloudKeyMapper.selectSslCloudKeyById(id);
    }

    /**
     * 查询云厂商key管理列表
     *
     * @param sslCloudKey 云厂商key管理
     * @return 云厂商key管理
     */
    @Override
    public List<SslCloudKey> selectSslCloudKeyList(SslCloudKey sslCloudKey)
    {
        return sslCloudKeyMapper.selectSslCloudKeyList(sslCloudKey);
    }

    /**
     * 新增云厂商key管理
     *
     * @param sslCloudKey 云厂商key管理
     * @return 结果
     */
    @Override
    public int insertSslCloudKey(SslCloudKey sslCloudKey)
    {
        sslCloudKey.setCreateTime(DateUtils.getNowDate());
        return sslCloudKeyMapper.insertSslCloudKey(sslCloudKey);
    }

    /**
     * 修改云厂商key管理
     *
     * @param sslCloudKey 云厂商key管理
     * @return 结果
     */
    @Override
    public int updateSslCloudKey(SslCloudKey sslCloudKey)
    {
        sslCloudKey.setUpdateTime(DateUtils.getNowDate());
        return sslCloudKeyMapper.updateSslCloudKey(sslCloudKey);
    }

    /**
     * 批量删除云厂商key管理
     *
     * @param ids 需要删除的云厂商key管理主键
     * @return 结果
     */
    @Override
    public int deleteSslCloudKeyByIds(String ids)
    {
        return sslCloudKeyMapper.deleteSslCloudKeyByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除云厂商key管理信息
     *
     * @param id 云厂商key管理主键
     * @return 结果
     */
    @Override
    public int deleteSslCloudKeyById(String id)
    {
        return sslCloudKeyMapper.deleteSslCloudKeyById(id);
    }

}
